<template>
  <div id="app">
    <Title/>
    <router-view></router-view>
    <!-- <Nav/> -->
   
  </div>
</template>

<script>
import Vue from 'vue'
import { Button } from 'vant';
import 'vant/lib/button/style';
Vue.use(Button);

import Title from './components/Title.vue'
//import Search from './components/search/search.vue'
// import Nav from './components/Nav.vue'

export default {
  name: 'App',
  components: {
    Title,
    //Search
    // Nav
  },
  methods:{
    beforeunloadFn(){
      let storage = window.localStorage;
      storage.removeItem('token')
    }
    
  },
  created(){
    window.addEventListener('beforeunload',()=>this.beforeunloadFn())
  },
  destroyed(){
    window.removeEventListener('beforeunload',()=>this.beforeunloadFn())  
  }
}
</script>

<style>
*{
  margin: 0;
  padding: 0;
}
</style>
